SERVER=$(shell awk '/SERVER *=/ { split($$0,arr,"="); gsub(" ","",arr[2]); print arr[2]; }' server.cnfg)
TARGET=$(SERVER)
TARGET_DEBUG=$(SERVER)_debug

default : debug

all : debug release

debug :
	$(MAKE) -C svr debug
	mv svr/$(TARGET_DEBUG) .
	mkdir -p _log

release :
	$(MAKE) -C svr release
	mv svr/$(TARGET) .
	mkdir -p _log

clean :
	$(MAKE) -C svr clean
	rm -fr _log
	rm -f core.* $(TARGET) $(TARGET_DEBUG)
